package com.wardrobe.dao.goods_model;

import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.goods_model.GoodsModelBean;
import com.wardrobe.mapper.master.goods_model.GoodsModelMasterMapper;
import com.wardrobe.mapper.slave.goods_model.GoodsModelSlaveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/16.
 */
@Service
public class GoodsModelDao {
    @Autowired
    private GoodsModelMasterMapper goodsModelMasterMapper;
    @Autowired
    private GoodsModelSlaveMapper goodsModelSlaveMapper;

    public int insertGoodsModel(GoodsModelBean goodsModelBean) {
        return goodsModelMasterMapper.insertGoodsModel(goodsModelBean);
    }

    public int updateGoodsModel(BackEndFromBean fromBean) {
        return goodsModelMasterMapper.updateGoodsModel(fromBean);
    }

    public GoodsModelBean selectGoodsModelById(long id) {
        return goodsModelSlaveMapper.selectGoodsModelById(id);
    }

    public List<GoodsModelBean> selectGoodsModelByGoodsId(long goodsId){
        return goodsModelSlaveMapper.selectGoodsModelByGoodsId(goodsId);
    }
}
